#!/usr/bin/evn python
# -*- coding: utf-8 -*-
from fastapi import FastAPI

from starlette.responses import PlainTextResponse

app = FastAPI()


@app.post("/api/v1/text1/")
async def index():
    return 'ok'  # 实际返回的类型是JSONResponse


@app.post("/api/v1/text2/")
async def index():
    return PlainTextResponse(status_code=404, content='ok')


if __name__ == "__main__":
    import uvicorn
    import os

    app_model_name = os.path.basename(__file__).replace(".py", "")
    print(app_model_name)
    uvicorn.run(f"{app_model_name}:app", host='127.0.0.1')
